package com.tinysand.advert.mysql.constant;

import com.github.shyiko.mysql.binlog.event.EventType;

/**
 * Created By TINY
 * Create Time 2020/2/27
 **/
public enum OperationType {
    ADD, UPDATE, DELETE, OTHER;

    public static OperationType convert(EventType eventType) {
        switch (eventType) {
            case EXT_WRITE_ROWS:
                return ADD;
            case EXT_UPDATE_ROWS:
                return UPDATE;
            case EXT_DELETE_ROWS:
                return DELETE;
            default:
                return OTHER;
        }
    }
}
